using System;
using UnityEngine;
using UnityEngine.UI;

[Serializable]
public class ImageAnim : EasyAnimBase
{
    public Gradient gradient;
    public Image image;
}

public class ImageAnimation : EasyAnimation<ImageAnim>
{
    protected override void Awake()
    {
        base.Awake();
        for(int i=0; i<anims.Length;i++)
        {
            anims[i].image = anims[i].targetObject.GetComponent<Image>();
        }
    }

    protected override void ApplyAnim(ImageAnim anim, float process)
    {
        Color val = anim.gradient.Evaluate(process) * anim.multiply;
        anim.image.color = val;
    }
}
